package com.ama.controller;

import com.ama.service.StaffService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

@Controller
public class DeleteStaffController {
    @Autowired
    StaffService staffService;

    @RequestMapping("/deleteStaff")
    public String deleteStaff(HttpServletRequest request, HttpSession session) {
        Long staffId = Long.valueOf(request.getParameter("staff"));
        staffService.deleteById(staffId);
        return "redirect:/pro_page/p_staffmanage.jsp";
    }
}
